package com.aaa.inside.feign;


import com.aaa.entity.stock.Stock;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(value = "stock-service")
public interface StockFeign {
    /*通过商品编名称和货位编码以及仓库id查出对应的一个库存*/
    @GetMapping("/stock/stock/selectStockByComBarOriLo")
    @ApiOperation("通过商品编名称和货位编码以及仓库id查出对应的一个库存")
    public Stock selectStockByComBarOriLo(@RequestParam String commoditybar
            ,@RequestParam String locatorcode,@RequestParam Long warehouseid);

    /*通过货位编码和仓库id查出对应的所有库存*/
    @GetMapping("/stock/stock/selectStockByLoCodeWareId")
    @ApiOperation("通过货位编码和仓库id查出对应的所有库存")
    public List<Stock> selectStockByLoCodeWareID(@RequestParam String locatorcode,
                                                 @RequestParam Long warehouseid);

    /*根据传入stock的实体id更新该stock*/
    @PostMapping("/stock/stock/updateById")
    @ApiOperation("根据传入stock的实体id更新该stock")
    public Boolean updateById(@RequestBody Stock stock);

    /*根据传入stock的实体id删除该stock*/
    @GetMapping("/stock/stock/removeById")
    @ApiOperation("根据传入stock的实体id删除该stock")
    public Boolean removeById(@RequestParam Long id);

    /*传入实体增加一行stock*/
    @PostMapping("/stock/stock/save")
    @ApiOperation("传入实体增加一行stock")
    public Boolean save(@RequestBody Stock stock);

    /*传入一个实体和一个条件根据条件将实体更新到这个条件对应的一行数据*/
    @RequestMapping(value = "/stock/stock/update",method = RequestMethod.POST)
    @ApiOperation("传入一个实体和一个条件根据条件将实体更新到这个条件对应的一行数据")
    public Boolean update(@RequestBody Stock stock, @RequestParam Map<String,Object> map);

    /*其他仓库库存*/
    @PostMapping("/stock/stock/selectStoCom")
    @ApiOperation("其他仓库库存")
    public List<Stock> selectStoCom();
}
